// import loader from '@utils/loader';
import { forEach } from 'lodash';
import { Socket } from 'socket.io';

type useFather = (config: modeConfig) => void;
const useFather: useFather = config => {
    // 注册socket
    forEach(config.eHubs as Socket[], eHub => {
        // eHub.on('prepare', (data: modeReturn) => {
        //     console.log(data);
        // });
        // eHub.on('setHero', () => {
        //     console.log('setHero');
        // });
        // eHub.on('', async () => {
        //     if (readyNum === config.playerNum) {
        //         console.log('所有玩家均已准备');
        //         const mode = await loader('mode', config.mode);
        //         mode.start(config);
        //     }
        // });
    });
};
export default useFather;
